﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Install.aspx.cs" Inherits="_Install"  %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>Commerce for Umbraco Installer</title>
  <style type="text/css">
      body {
        font-family: Verdana, Arial;
      }
      
      a {
        color: #E03300;
        text-decoration: none;
        font-weight: bold;
        font-size: 1em;
      }
      
      .payPalLink {
        color: #E03300;
        text-decoration: underline;
        font-weight: bold;
        font-size: 1em;
      }
      
      .mainContent {
      	margin: 10px auto;
        /*margin: 20px;*/
        width: 760px;
        padding: 5px;
      }
      
      .logo {
        display: block;
        padding-bottom: 10px;
      }
      
      .wizard {
        display: block;
        width: 100%;
      }
      
      .stepHeader {
        font-size: 1.1em;
        font-weight: bold;
        text-align: center;
        width: 100%;
      }

      .messageCenter {
        width: 100%;
        height: 30px;
        color: #004A78;
        font-size: .9em;
      }
      
      .imgIcon {
        float: left;
      }
    </style>
</head>
<body>
  <form id="form1" runat="server">
    <div class="mainContent">
      <div class="logo">
        <img src="images/dc4umb.png" alt="Commerce for Umbraco" />
      </div>
      <asp:Wizard ID="wizInstaller" runat="server" DisplaySideBar="false" OnNextButtonClick="next_Click"
        OnFinishButtonClick="finish_Click" OnActiveStepChanged="activeStepChanged" CssClass="wizard" ActiveStepIndex="0">
        <WizardSteps>
			<asp:WizardStep runat="server" ID="wzsWelcome">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Welcome" ID="lblStepHeader">
					</asp:Label>
				</div>
				<p>This installation wizard will guide you through the installation of Commerce for Umbraco.</p>
				<p>This install process supports new installs only.</p>
				<p>Before you begin, you need to grant the ASPNET (Windows XP) or the NETWORK SERVICE 
				(Windows Server) accounts "<strong>Modify</strong>"
              and "<strong>Write</strong>" access to the Web.config file.
              </p>
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs1">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 1 of 6: Test Write Access to web.config" ID="Label3">
					</asp:Label>
				</div>
				<p>Clicking "Next" will test a write operation to the Web.config to ensure it has the
              correct permissions . . .</p>
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs2">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 2 of 6: Gather Database Server Credentials" ID="Label1">
					</asp:Label>
				</div>
				<p>Now it is time to set up the Commerce for Umbraco database.</p>
				<p>We will create new database here that is unrelated to the Umbraco database.</p>
				<p>This step will gather the neccessary database server credentials, which will then
              be used to install the database in the next step.</p>
				<p>If you would prefer to manually install the database, the SQL Script files are located at 
            .</p>
				Please run them in the following order:
				<ol>
					<li>Tables.sql</li>
					<li>Functions.sql</li>
					<li>Views.sql</li>
					<li>SPs.sql</li>
					<li>BaseData.sql</li>
					<li>Membership.sql</li>
					<li>BaseMembershipData.sql</li>
					<li>C4Usql.sql</li>
					<li>SampleData.sql <strong>(OPTIONAL)</strong></li>
				</ol>
				<asp:Label runat="server" Text="Database Server:" CssClass="stepHeader" ID="lblDbServer">
				</asp:Label>
				<br />
				<asp:TextBox runat="server" Text="localhost\SQLEXPRESS" CssClass="textbox" Width="150px" ID="txtDbServer">
				</asp:TextBox>
				<br />
				<br />
				<asp:Label runat="server" Text="Use Trusted Connection:" CssClass="stepHeader" ID="lblTrustedConnection">
				</asp:Label>
				<br />
				<asp:CheckBox runat="server" AutoPostBack="True" Checked="True" ID="chkTrustedConnection" OnCheckedChanged="chkTrusted_CheckedChanged" />
				<br />
				<br />
				<asp:Panel runat="server" ID="pnlSqlMode" Visible="False">
					<p>Please note: This wizard will give you the opportunity to either select the 
              database from the a list or create a new database. If you choose to create a new 
              database, the account provided here must have <strong>dbCreator</strong> rights 
              on the SQL Server. If your account does not have these rights, you will have to create 
              the database first and then select from the list provided in the next step.</p>
					<asp:Label runat="server" Text="Username:" ID="lblDbUserName">
					</asp:Label>
					<br />
					<asp:TextBox runat="server" CssClass="textbox" ID="txtDbUserName">
					</asp:TextBox>
					<br />
					<br />
					<asp:Label runat="server" Text="Password:" ID="lblDbPassword">
					</asp:Label>
					<br />
					<asp:TextBox runat="server" CssClass="textbox" ID="txtDbPassword">
					</asp:TextBox>
					<br />
					<br />
					<asp:RequiredFieldValidator runat="server" ControlToValidate="txtDbUserName" ErrorMessage="Please supply a Username." Display="None" ID="RequiredFieldValidator1">
					</asp:RequiredFieldValidator>
					<asp:RequiredFieldValidator runat="server" ControlToValidate="txtDbPassword" ErrorMessage="Please supply a Password." Display="None" ID="RequiredFieldValidator2">
					</asp:RequiredFieldValidator>
				</asp:Panel>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtDbServer" ErrorMessage="Please supply a Database Server." Display="None" ID="rfvDbServer">
				</asp:RequiredFieldValidator>
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs3">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 3 of 6: Select or Create the Commerce for Umbraco Database" ID="Label2">
					</asp:Label>
				</div>
				<p>This step will install the necessary database objects and the base data needed to
              run Commerce for Umbraco. This includes the ASP.NET Membership database objects.</p>
				<asp:Label runat="server" Text="Databases:" CssClass="label" ID="lblDbList">
				</asp:Label>
				<br />
				<asp:DropDownList runat="server" CssClass="textbox" ID="ddlDbList">
				</asp:DropDownList>
				<br />
				<br />
				<asp:CheckBox runat="server" ID="chkDropObjects" />
				<asp:Label runat="server" Text=" Drop Commerce for Umbraco objects in target database." ID="lblDropObjects">
				</asp:Label>
				<p><strong>Please Note: Droping Commerce for Umbraco objects will remove all data and database objects. 
            Use this feature only if you understand what it does. This feature may cause the operation to 
            take a few minutes to complete.</strong></p>
				- or -<br />
				<br />
				<asp:Label runat="server" Text="Create Database:" ID="lblCreateDb">
				</asp:Label>
				<br />
				<asp:TextBox runat="server" CssClass="textbox" Width="150px" ID="txtCreateDb">
				</asp:TextBox>
				<br />
				<br />
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs4">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 4 of 6: Create the Commerce for Umbraco Administrator Account" ID="Label5">
					</asp:Label>
				</div>
				<p>You will now create the Administrator account which will allow you administer Commerce 
for Umbraco.</p>
				<table border="0">
					<tr>
						<td>
						<asp:Label runat="server" Text="Username:" ID="lblUsername">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="1" Width="150px" ID="txtUsername">
						</asp:TextBox>
						<br />
						<br />
						</td>
						<td>
						<asp:Label runat="server" Text="Email:" ID="lblEmail">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="4" Width="150px" ID="txtEmail">
						</asp:TextBox>
						<br />
						<br />
						</td>
					</tr>
					<tr>
						<td>
						<asp:Label runat="server" Text="Password:" ID="lblPassword">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="2" Width="150px" ID="txtPassword">
						</asp:TextBox>
						<br />
						<br />
						</td>
						<td>
						<asp:Label runat="server" Text="Confirm Email:" ID="lblConfirmEmail">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="5" Width="150px" ID="txtConfirmEmail">
						</asp:TextBox>
						<br />
						<br />
						</td>
					</tr>
					<tr>
						<td>
						<asp:Label runat="server" Text="Confirm Password:" ID="lblConfirmPassword">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="3" Width="150px" ID="txtConfirmPassword">
						</asp:TextBox>
						<br />
						<br />
						</td>
						<td>
						<asp:Label runat="server" Text="Security Question:" ID="lblSecurityQuestion">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="6" Width="150px" ID="txtSecurityQuestion">
						</asp:TextBox>
						<br />
						<br />
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
						<asp:Label runat="server" Text="Security Answer:" ID="lblSecurityAnswer">
						</asp:Label>
						<br />
						<asp:TextBox runat="server" CssClass="textbox" TabIndex="7" Width="150px" ID="txtSecurityAnswer">
						</asp:TextBox>
						<br />
						<br />
						</td>
					</tr>
				</table>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtUsername" ErrorMessage="Please supply a Username." Display="None" ID="rfvUsername">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtPassword" ErrorMessage="Please supply a Password." Display="None" ID="rfvPassword">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtConfirmPassword" ErrorMessage="Please supply a Confirm Password." Display="None" ID="rfvConfirmPassword">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtEmail" ErrorMessage="Please supply an Email." Display="None" ID="rfvEmail">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtConfirmEmail" ErrorMessage="Please supply a Confirm Email." Display="None" ID="rfvConfirmEmail">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtSecurityQuestion" ErrorMessage="Please supply a Security Question." Display="None" ID="rfvSecurityQuestion">
				</asp:RequiredFieldValidator>
				<asp:RequiredFieldValidator runat="server" ControlToValidate="txtSecurityAnswer" ErrorMessage="Please supply a Security Answer." Display="None" ID="rfvSecurityAnswer">
				</asp:RequiredFieldValidator>
				<asp:CompareValidator runat="server" ControlToCompare="txtConfirmPassword" ControlToValidate="txtPassword" ErrorMessage="Passwords do not match." Display="None" ID="cmpPassword">
				</asp:CompareValidator>
				<asp:CompareValidator runat="server" ControlToCompare="txtConfirmEmail" ControlToValidate="txtEmail" ErrorMessage="Emails do not match." Display="None" ID="cmpEmail">
				</asp:CompareValidator>
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs5">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 5 of 6: Populate Sample Data" ID="Label4">
					</asp:Label>
				</div>
				<p>Please decide if you would like to have the database loaded with sample data.</p>
				<p>If this is your first time using the product, you may wish to have the sample data 
            loaded so you can evaluate the functionality.</p>
				<asp:Label runat="server" Text="Load Sample Data:" ID="lblLoadSampleData">
				</asp:Label>
				<asp:RadioButton runat="server" GroupName="SampleData" Checked="True" Text="Yes" ID="rdoYes" />&nbsp;&nbsp;&nbsp;
				<asp:RadioButton runat="server" GroupName="SampleData" Text="No" ID="rdoNo" />
			</asp:WizardStep>
			<asp:WizardStep runat="server" ID="wzs6">
				<div class="stepHeader">
					<asp:Label runat="server" Text="Step 6 of 6: Sign Up for a PayPal Business Account" ID="Label6">
					</asp:Label>
				</div>
				<p>Motus Connect, Inc. has partnered with PayPal to give you a complete e-commerce and 
            all-in-one payment solution using PayPal's Express Checkout and Website Payments Pro.</p>
				<ul>
					<li>Accept credit card payments without requiring the buyer to have a PayPal account.</li>
					<li>Get PayPal's industry-leading security fraud-prevention systems.</li>
					<li>Take advantage of PayPal's comprehensive online reports that help you measure sales and manage your business easily.</li>
				</ul>
				<p><strong>Step 1: Set Up a Verified PayPal Business Account</strong></p>
				<p>If you don't have an existing PayPal account:</p>
				<ol>
					<li>
					<a target="_blank" href="https://www.paypal.com/us/mrb/pal=M7FFTEU5FMWKC">
					<span class="payPalLink">Go to Paypal</span></a></li>
					<li>Click Sign Up Today.</li>
					<li>Set up an account for Business Owners.</li>
					<li>Follow the instructions on the PayPal site.</li>
				</ol>
				<p>If you already have a Personal or Premier account:</p>
				<ol>
					<li>
					<a target="_blank" href="https://www.paypal.com/us/mrb/pal=M7FFTEU5FMWKC">
					<span class="payPalLink">Go to Paypal</span></a></li>
					<li>Click the Upgrade your Account link.</li>
					<li>Click the Upgrade Now button.</li>
					<li>Choose to upgrade to a Business account and follow instructions to complete the upgrade.</li>
					<li>If you haven't already, add a bank account to become a Verified member. Follow the instructions on the PayPal site. (This process may take 2-3 business days.)</li>
				</ol>
				<p><strong>Step 2: Apply for Website Payments Pro</strong></p>
				<p>Get the features of an internet merchant account and payment gateway with Website Payments Pro. Control your checkout from start to finish by integrating PayPal Website Payments Pro with Commerce for Umbraco.</p>
				<ol>
					<li>
					<a target="_blank" href="https://www.paypal.com/us/mrb/pal=M7FFTEU5FMWKC">
					<span class="payPalLink">Go to Paypal</span></a></li>
					<li>Login to your PayPal Business Account</li>
					<li>Click the Merchant Services tab.</li>
					<li>Click Website Payments Pro (U.S. Only).</li>
					<li>Click Sign Up Now.</li>
					<li>Fill in your information, and submit your application. Approval takes between 24 and 48 hours.</li>
					<li>Once approved, accept the Pro billing agreement. Check the Getting Started section on the upper left of your account overview page.</li>
				</ol>
				<!-- Begin PayPal Logo -->
				<A HREF="https://www.paypal.com/us/mrb/pal=M7FFTEU5FMWKC" target="_blank">
				<IMG SRC="http://images.paypal.com/en_US/i/bnr/paypal_mrb_banner.gif" 
				BORDER="0" ALT="Sign up for PayPal and start accepting credit card payments instantly.">
				</IMG>
				</A>
				<!-- End PayPal Logo -->
			</asp:WizardStep>
		</WizardSteps>
      </asp:Wizard>
      <div class="messageCenter">
        <asp:Image ID="imgMessage" runat="server" ImageUrl="" CssClass="imgIcon" /><asp:Label
          ID="lblMessage" runat="server" Text="" />
        <asp:ValidationSummary ID="valSummary" runat="server" DisplayMode="BulletList" ShowSummary="true" />
      </div>
      <br />
      <div id="footer">
        <a href="http://www.motusconnect.com/" target="_blank">Commerce for Umbraco - Beta 1.0</a><br />
        <a href="http://www.dashcommerce.org/" target="_blank">portions based on dashCommerce 2.2</a>
        <br />
      </div>
      
    </div>
  </form>
</body>
</html>
